package com.leyou.seckill.client;

import com.leyou.seckill.dto.SeckillPolicyDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("seckill-service")
public interface SeckillClient {

    @GetMapping("/findSeckillByDate")
    public List<SeckillPolicyDTO> findSeckillListByDate(@RequestParam("nowDate") String nowDate);

    @GetMapping("/{id}")
    public SeckillPolicyDTO findSecKillPolicyById(@PathVariable(name = "id") Long id);
    @PutMapping("/stockMinus/{id}")
    void stockMinus(@PathVariable(name = "id") Long seckillId);
}
